<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
                   
class Hessian extends CI_Controller {

	function __construct() {
		parent::__construct();		$this->load->library('Maitaidata');
	}	 
           
	public function index(){	
	}

	public function getgadgetlist(){

		$arr =  get_object_vars($this->maitaidata->getGadgetList("","",10,10000)) ;
		var_dump($arr);
	}
 	
	public function getpromotypelist(){
		$arr = json_encode(get_object_vars($this->maitaidata->getPromoTypeList(""))) ;
		die($arr);
	}
 
	public function getstorelist(){
		$arr =  get_object_vars($this->maitaidata->getStoreList("","","")) ;
		var_dump($arr);
	}
	public function getpromovaliditylist(){
		$arr =  json_encode(get_object_vars($this->maitaidata->getPromoValidityList("8"))) ;
		die($arr);
	}
	public function getpromolist(){ // not working params
		//$arr =  get_object_vars($this->maitaidata->getPromoList("9","UNLI CALLS",64)) ;
		$arr =  get_object_vars($this->maitaidata->getPromoList("13","UNLI CALLS",7)) ;
		var_dump($arr);
	}
	public function getcommitmentperiod(){
		//$arr =  get_object_vars($this->maitaidata->getCommitmentPeriod("15")) ;
		$arr =  get_object_vars($this->maitaidata->getCommitmentPeriod("3", 3000)) ;
		var_dump($arr);
	}
	public function checkmsisdn($num){
		// not working
		$arr =  get_object_vars($this->maitaidata->checkMsisdn($num)) ;
		var_dump($arr);
	}
	public function registersubscriber(){
		// param should be object 

		$fName = "firstq";
		$mName = "middleq";
		$lName = "last";
		$email = "test@fluxion.com.ph";
		$msisdn = "09159252640";
		$birthdate = "10/10/2014";
		$streetNum = "addresssQQ";
		$area = "";
		$town = "Balite";
		$province = "Batangas";
		$postalCode = "4219";
		$gadgetId = "7";
		$promoId = "1";
		$commitmentPeriod = "12";
		$storeId = "25";
		$channelId = "2";		

		$arr =  get_object_vars($this->maitaidata->registerSubscriber($fName, $mName, $lName, $email, $msisdn, $birthdate, $streetNum, $area, $town, $province, $postalCode, $gadgetId, $promoId, $commitmentPeriod, $storeId, $channelId)) ;
		var_dump($arr);
	}

	public function getsubscriptiondetails($promocode){
		$arr =  get_object_vars($this->maitaidata->getsubscriptiondetails($promocode)) ;
		var_dump($arr);
	}

}
